﻿<!DOCTYPE>

<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=EDGE;IE=11;IE=8,chrome=1" />
    <title>批次解冻</title>
    <link href="/InSiteWebApplication/Content/Easyui/themes/metro/easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/custom-easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/themes/icon.css" rel="stylesheet" />
    <style type="text/css">
        .linkbutton{margin-left:20px;}
         table tr td{padding:0px 5px}
         .divLabel td{text-align: end;text-align: right;}
         #txtproductContent{width: 120px; height: 22px}
    </style>
</head>
<body>
 <div class="panelSection">    
        <div class="easyui-panel " title="查询区域" style="padding:3px;width: 100%" 
        data-options="closable:false,collapsible:true,minimizable:false,maximizable:false">
        <form id="searchForm" style="margin-bottom: 2px;">
               <table>
                <tr>
                    <td>订单号：</td>
                    <td>零件号：</td>
                    <td>批次号：</td>
                    <td>状态：</td>
                </tr>
                <tr>
                    <td><input id="txtMfgorderName" class="easyui-textbox" name="MfgOrdername" type="text" style="width: 120px; height: 22px" /></td>
                    <td><input id="txtProductName" class="easyui-textbox" name="ProductName" type="text" style="width: 120px; height: 22px" /></td>
                    <td><input id="txtContainerName" class="easyui-textbox" name="ContainerName" type="text" style="width: 120px; height: 22px" /></td>
                    <td><input id="txtContainerStatus" class="easyui-textbox" name="ContainerStatus" type="text" style="width: 120px; height: 22px" /></td>
                    <td><a href="javascript:void(0)" id="btnSearch" class="easyui-linkbutton"   onclick="page.searchData()">查询</a>
                    <a href="javascript:void(0)" id="btnReset" class="easyui-linkbutton"   onclick="page.searchReset()">重置</a>
                    </td>
                </tr>
            </table>
        </form> 
        </div> 
    </div> 
      <div class="panelSection">    
        <div class="easyui-panel " title="流水卡信息" style="padding:3px;width: 100%" data-options="closable:false,collapsible:true,minimizable:false,maximizable:false"> 
        <div class="easyui-layout" style="width:100%;height:400px;">
		    <div data-options="region:'center'" title="">
                <table id="ContainerTable" style="height:363px;width:100%"></table>
                     <div id="pp" style="float: right" class="easyui-pagination" data-options="   
                         layout:['first','prev','next','last','manual','info'],              
                            total: 0,
                            showPageList: false,
                            showPageInfo: false,
                            showRefresh: false,
                            afterPageText:'共&nbsp{pages}&nbsp页',
                             buttons:[{
                                    iconCls:'',
                                    text:'Go',
                                    id:'pageGo'
                            }]
                        ">
                            </div>
		    </div>
            <div data-options="region:'east'"  style="width:35%;">
			    <table id="ContainerDTable" class="easyui-datagrid" style="width: 100%;"data-options="rownumbers:true">
                </table>
		    </div>
	</div>
        </div>
      </div>
       <div class="panelSection">    
        <div class="easyui-panel " title="解冻信息" style="padding:3px;width: 100%" data-options="closable:false,collapsible:true,minimizable:false,maximizable:false"> 
            <table id="UnFreezeTable" class="easyui-datagrid" style="width: 100%;height:340px;"data-options="rownumbers:true">
                </table>
        </div>
      </div>
      <div class="panelSection">    
        <div class="easyui-panel " title="按钮区域" style="padding:3px;width: 100%" data-options="closable:false,collapsible:true,minimizable:false,maximizable:false"> 
            <div style="margin:15px 0px">
                  <a href="javascript:void(0)" class="easyui-linkbutton linkbutton" onclick="page.OpenCreateMfg()">批次调度</a>
                  <a href="javascript:void(0)" class="easyui-linkbutton linkbutton" onclick="page.OpenCreateContainer();">批次分批</a>
                  <a href="javascript:void(0)" class="easyui-linkbutton linkbutton" onclick="page.MfgOrderOpenOrStop();">解冻提交</a>
                  <a href="javascript:void(0)" class="easyui-linkbutton linkbutton" onclick="page.MfgOrderOpenOrStop();">解冻审核</a>
                  <a href="javascript:void(0)" class="easyui-linkbutton linkbutton" onclick="page.MfgOrderOpenOrStop();">退回</a>
            </div>
      </div>
      </div>
      <div id="statusMessage" style="font-size: 14px; height: 40px"></div>
</body>
</html>
<script src="/InSiteWebApplication/Scripts/CustomPageJs/ReferenceJsLib.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Scripts/CustomPageJs/CustomCommon.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Scripts/array.pollyfill.js" type="text/javascript"></script>


<script type="text/javascript">
/*
创建人：longb
日期：2025-06-18
描述：排故流卡创建js
*/
var page = {
    pagetotal: 0,
    pageSize: 20,
    pageNumber: 1,
    factoryName:null,
    ajaxUrl: getRootPath() + "/Ashx/ContainerUnFreezeHandler.ashx",
    //初始化页面
    init: function () {
        page.bind();
        NewcustomizedEasyuiPagination('pp'); //定制化分页
        $('#pp').find('.pageSize').val(page.pageSize); //初始化行数
    },
    //页面事件绑定
    bind: function () {
        $('#txtContainerStatus').combobox({
            data: [{ id:'0', text: '未提交' }, { id:'1', text: '已提交'}],
            valueField: 'id',
            textField: 'text'
        });
        $('#txtContainerStatus').combobox('setValue', '0');
        //订单信息
        $("#ContainerTable").datagrid({
            checkOnSelect: false,
            selectOnCheck: false,
            singleSelect: true,
            rownumbers: true,
            onLoadSuccess: function (data) {
                $('#pp').pagination('refresh', {	// 改变选项，并刷新分页栏信息
                    total: page.pagetotal,
                    pageSize: page.pageSize,
                    pageNumber: page.pageNumber
                });
                NewcustomizedEasyuiPagination('pp'); //定制化分页
            },
            columns: [[
                 { field: 'ck', title: '选择', checkbox: true },
                 { field: 'MFGORDERNAME', title: '生产订单', width: 150 },
                 { field: 'PRODUCTNAME', title: '件号/批次号', width: 150 },
                 { field: 'DESCRIPTION', title: '零件名称', width: 150 },
                 { field: 'QTY', title: '在制数', width: 100 },
                 { field: 'WORKFLOWINFO', title: '工艺版本及路线', width: 170 },
                 { field: 'CURRENTWORKFLOWSTEP', title: '当前工序', width: 120 },
                 { field: 'CONTAINERTYPE', title: '批次类型', width: 120 }
	           ]],
               onSelect: function (index, rowData) {
                $("#ContainerTable").datagrid("uncheckAll").datagrid("checkRow",index);//单选行，去掉同时勾选
                page.reset(false, false, true);
                page.searchDealContainer();
            },
        });
        $("#ContainerDTable").datagrid({
            columns: [[
                { field: 'CONTAINERNAME', title: '批次号', width: 150 },
                { field: 'QTY', title: '在制数量', width: 90 }
	           ]]
        });
        $("#UnFreezeTable").datagrid({
            columns: [[
                { field: 'CONTAINERNAME', title: '流水卡号', width: 150 },
                { field: 'PROPOSER', title: '申请人', width: 150 },
                { field: 'PROPOSERDATE', title: '申请时间', width: 150 },
                { field: 'RELEARSEEMP', title: '释放人', width: 150 },
                { field: 'RELEARSEDATE', title: '释放时间', width: 150 }
	           ]]
        });
        //分页事件
        $('#pp').pagination({
            onSelectPage: function (pageNumber, pageSize) {
                NewcustomizedEasyuiPagination('pp'); //定制化分页
                page.pageSize = pageSize; page.pageNumber = pageNumber;
                page.GetHoldContainerData();
            }
        });
        //绑定分页go按钮
        $('#pageGo').on("click", function () {
            var pageNumber = $(this).parents('tr').find('.pagination-num').val();
            page.pageNumber = pageNumber;
            page.pageSize=$('#pp').find('.pageSize').val() == "" ? page.pageSize : Number($('#pp').find('.pageSize').val());
            page.GetHoldContainerData();
        });
        //清除按钮
        $('#btnReset').on("click", function () {
            page.reset(true, true,true);
        });

        
    },
    //查询
    searchData: function () {
        page.reset(false,true,true);
        page.pageNumber = 1;
        page.GetHoldContainerData();
    },
    //查询订单单信息
    GetHoldContainerData: function () {
        var frdata = $('#searchForm').serializeArray();
        var data = {};
        $.each(frdata, function () {
            data[this.name] = this.value
        });
        var param = {
            action: "GetHoldContainerData",
            pageSize: page.pageSize,
            pageNumber: page.pageNumber,
            data: JSON.stringify(data)
        };
        page.post(null,param, function (res) {
            if (res.Result) {
                page.pagetotal = res.RowCount;
                $('#ContainerTable').datagrid('loadData', res.DBTable);
            }
        });
    },
    
    
    //查询重置
    searchReset: function () {
        page.reset(true,true,true);
    },

    //清除方法，重要！！！
    reset: function (iscondition, isresult, isDetail) {
        clearMessage();
        if (iscondition) {
            $("#txtMfgorderName").textbox("setValue", ""); //订单号
            $("#txtProductName").textbox("setValue", ""); //件号
            $("#txtContainerName").textbox("setValue", ""); //任务单
            $("#txtContainerStatus").textbox("setValue", ""); //批次状态
        }

        if (isresult) {
            clearEasyuiDataGrid("ContainerTable", 1); //查询结果列表
            $('#EditorForm').form('clear');
            page.pageNumber = 1; page.pagetotal = 0;//重置分页
            $('#pp').pagination('refresh', {
                total: page.pagetotal,
                pageSize: page.pageSize,
                pageNumber: page.pageNumber
            });
        }
        if(isDetail)
        {
            clearEasyuiDataGrid("ContainerDTable", 1); //明细信息
            clearEasyuiDataGrid("UnFreezeTable", 1); //明细信息
        }
    },
    //post数据
    post: function (url,param, callback) {
        $.ajax({
            type: "Post",
            url:url==null?page.ajaxUrl:url,
            data: param,
            cashe: false,
            async: true,
            dataType: "json",
            beforeSend: function () {
                $.messager.progress({ text: '', msg: '处理中...' });
            },
            success: function (data) {
                $.messager.progress('close');
                callback(data);
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                $.messager.progress('close');
                displayMessage(XMLHttpRequest.responseText, false);
            }
        });
    }
}
$(function () {
    page.init();
});

</script>
